﻿using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Content;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Christoc.Modules.CouponsDiscounts.Components
{
    public class Transaction : ContentItem
    {
        public int TransactionId { get; set; }

        public int ProductId { get; set; }

        public int DiscountId { get; set; }

        public double Price { get; set; }

        public DateTime TransactionDate { get; set; }


        public override void Fill(System.Data.IDataReader dr)
        {
            base.FillInternal(dr);

            TransactionId = Null.SetNullInteger(dr["TransactionID"]);
            ProductId = Null.SetNullInteger(dr["ProductID"]);
            DiscountId = Null.SetNullInteger(dr["DiscountID"]);

            Price = Null.SetNullSingle(dr["PriceSold"]);
            TransactionDate = Null.SetNullDateTime(dr["TransactionDate"]);

        }

        public override int KeyID
        {
            get { return TransactionId; }
            set { TransactionId = value; }
        }
    }
}